#ifndef __SONAR_TEST_H__
#define __SONAR_TEST_H__
#include "cocos2d.h"

static float getDistance(const cocos2d::CCPoint& p1, const cocos2d::CCPoint& p2);

static cocos2d::CCPoint getDrawPointByLogicPoint(const cocos2d::CCPoint& point);


class GameScene;
class CSonarTest
{
public:
	CSonarTest(GameScene* game_scene);
	~CSonarTest();

	bool init();
	void update(float dt);
	bool isOver();

private:
	float getTargetResponseTime(float distance);
	void sonarTest(float t);
	void TestResponse(float t);
	const char* getImageName(int count_index) const;

private:
	typedef std::vector<cocos2d::CCSprite*> SonarTestVec;
	GameScene*			m_game_scene;

	cocos2d::CCPoint	m_player_pos;
	cocos2d::CCPoint	m_screen_interval;
	SonarTestVec		m_sonar_test_vec;
	bool				m_test_created;
	int					m_sonar_test_count;
	float				m_region;
	
	bool				m_response_created;
	SonarTestVec		m_test_response_vec;
	//cocos2d::CCSprite*	m_sonar_test_response;
	//cocos2d::CCAction*	m_scale_action_response;

	float				m_sonar_test_response_time;
	float 				m_response_continue_time;

	
};
#endif